Skip to content

Conversation

@EldarShalev
Copy link

@EldarShalev EldarShalev commented Feb 8, 2026

I've implemented the ESO (External Secrets Operator) CRDs collection following the same minimal pattern as the ConfigMaps feature #769 .

Here's what was done:
Files Modified:
deploy/charts/disco-agent/templates/configmap.yaml
Added two new k8s-dynamic data gatherers:
ark/externalsecrets (group: external-secrets.io, version: v1, resource: externalsecrets)
ark/secretstores (group: external-secrets.io, version: v1, resource: secretstores)
No label selectors used (Option A: collect all in watched namespaces)

deploy/charts/disco-agent/tests/snapshot/configmap_test.yaml.snap
Updated all 4 test snapshot sections to include both ESO gatherers

examples/machinehub.yaml
Added both ESO gatherers with comments explaining their purpose

examples/machinehub/input.json
Added empty items entries for both ark/externalsecrets and ark/secretstores

internal/cyberark/dataupload/dataupload.go
Added ExternalSecrets []runtime.Object and SecretStores []runtime.Object fields to the Snapshot struct

pkg/client/client_cyberark.go
Added extractor functions for ark/externalsecrets and ark/secretstores

pkg/client/client_cyberark_test.go
Added both gatherers to defaultDynamicDatagathererNames list

pkg/client/client_cyberark_convertdatareadings_test.go
Added TestConvertDataReadings_ExternalSecrets test
Added TestConvertDataReadings_SecretStores test
Both tests verify: 2 resources are extracted, deleted resources are excluded
Files Created:
hack/ark/external-secret.yaml
Sample ExternalSecret CR for e2e testing (uses fake backend)
hack/ark/secret-store.yaml
Sample SecretStore CR for e2e testing (uses fake provider)
hack/ark/test-e2e.sh
Updated to apply both ESO sample manifests (with fallback if CRDs not installed)

Copy link
Contributor

@achuchev achuchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR looks promising. I think the main area for improvement is implementing logic to exclude sensitive data. Unfortunately, the spec.provider.fake.data may include passwords in the manifest. Although the Fake provider is intended for testing purposes only, it still contains customer-sensitive data.

The potentially sensitive branch could be removed by applying the same approach used for managedFields.

version: v1
label-selectors:
- conjur.org/name=conjur-connect-configmap
- kind: k8s-dynamic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include the cluster-scoped resources: clusterexternalsecrets and clustersecretstores.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or not, I need to add everything i did (for all files) the same for clusterexternalsecrets and clustersecretstores?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now done @achuchev

#
# These require the ESO CRDs to be installed in the cluster. If the CRDs are not
# installed, these commands will fail but the e2e test can still proceed.
kubectl apply -f "${root_dir}/hack/ark/secret-store.yaml" || echo "Warning: SecretStore CRD not installed, skipping"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unable to find where the ESO CRDs have been deployed. If the CRDs are not in place, the CR will also not be deployed, which does not bring much value for the e2e.

"ark/configmaps": func(r *api.DataReading, s *dataupload.Snapshot) error {
return extractResourceListFromReading(r, &s.ConfigMaps)
},
"ark/externalsecrets": func(r *api.DataReading, s *dataupload.Snapshot) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"ark/externalsecrets": func(r *api.DataReading, s *dataupload.Snapshot) error {
"ark/esoexternalsecrets": func(r *api.DataReading, s *dataupload.Snapshot) error {

It may be helpful to add a prefix to the names to clarify which project they originate from.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, but I guess you dont mean only here right?
just to understand the scope of the prefix

@achuchev achuchev self-requested a review February 9, 2026 09:27
@achuchev achuchev added the test-e2e To signal e2e test job to be run label Feb 9, 2026
@inteon
Copy link
Contributor

inteon commented Feb 9, 2026

@EldarShalev could you run make fix-golangci-lint?

@EldarShalev
Copy link
Author

@EldarShalev could you run make fix-golangci-lint?

will try to fix it, getting

make/connection_crd/main.go:6:6: could not import github.com/jetstack/venafi-connection-lib/config/crd/bases (make/connection_crd/main.go:6:2: reading github.com/jetstack/venafi-connection-lib/go.mod at revision v0.5.2: git ls-remote -q origin in /Users/eldar.shalev/go/pkg/mod/cache/vcs/e1445deb79b4ca14ee954e0f79f4034748b368f02a81510920a656b6ce2c6380: exit status 128:
        ERROR: Repository not found.
        fatal: Could not read from remote repository.
        
        Please make sure you have the correct access rights
        and the repository exists.) (typecheck)
        crd "github.com/jetstack/venafi-connection-lib/config/crd/bases"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-e2e To signal e2e test job to be run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants